home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1067 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.4 KB  |  110 lines

  1. Path: news.uni-ulm.de!news
  2. From: gutmann@informatik.uni-ulm.de (Jens-Steffen Gutmann)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: slink V6.56 problem
  5. Date: 15 Jan 1996 12:35:00 GMT
  6. Organization: University of Ulm, Germany
  7. Message-ID: <4ddhlk$hms@oracle.rz.uni-ulm.de>
  8. Reply-To: gutmann@informatik.uni-ulm.de
  9. NNTP-Posting-Host: gaius.informatik.uni-ulm.de
  10.  
  11. Slink V6.56 seems to have problems when linking large object files.
  12. I noticed it when trying to recompile the gnuplot source code.
  13. Here is some code to produce a large source file:
  14.  
  15. ----------------------------cut-here--------------------------------------
  16. #include <stdio.h>
  17.  
  18. int main(int argc, char **argv)
  19. {
  20.     int i;
  21.  
  22.     printf("#include <stdio.h>\n\n");
  23.  
  24.     for(i=0; i < 2000; i++)
  25.     printf("void test%d(void) { printf(\"Test%d\\n\"); }\n", i, i);
  26.  
  27.     printf("\nint main(int argc, char **argv)\n{ return(0); }\n");
  28.     return(0);
  29. }
  30. ----------------------------cut-here--------------------------------------
  31.  
  32. Save this code to a file genprob.c and compile and link it:
  33.  
  34. --------------------------------------------------------------------------
  35. Home:Prog/problems/linker > sc link genprob.c
  36. SAS/C Amiga Compiler 6.56
  37. Copyright (c) 1988-1995 SAS Institute Inc.
  38. Slink - Version 6.56
  39. Copyright (c) 1988-1995 SAS Institute, Inc.  All Rights Reserved.
  40.  
  41.  
  42. SLINK Complete - Maximum code size = 5936 ($00001730) bytes
  43.  
  44. Final output file size = 5952 ($00001740) bytes
  45. --------------------------------------------------------------------------
  46.  
  47. Execute the new binary and save the output to linkprob.c:
  48.  
  49. --------------------------------------------------------------------------
  50. Home:Prog/problems/linker > genprob > linkprob.c
  51. --------------------------------------------------------------------------
  52.  
  53. Now try to compile and link it:
  54.  
  55. --------------------------------------------------------------------------
  56. Home:Prog/problems/linker > sc link linkprob.c
  57. SAS/C Amiga Compiler 6.56
  58. Copyright (c) 1988-1995 SAS Institute Inc.
  59. Slink - Version 6.56
  60. Copyright (c) 1988-1995 SAS Institute, Inc.  All Rights Reserved.
  61.  
  62. Error 502: __writes symbol - Distance for Reloc16 > 32768
  63.  
  64.   First Reference in Unit linkprob.c at offset 00005ac2 in file 'linkprob.o'
  65.   To Unit writes.c at offset 00004350 in file 'LIB:sc.lib'
  66. Home:Prog/problems/linker >
  67. --------------------------------------------------------------------------
  68.  
  69. The SCOPTIONS file contains:
  70.  
  71. --------------------------------------------------------------------------
  72. Home:Prog/problems/linker > cat SCOPTIONS
  73. CODE=FAR
  74. ERRORREXX
  75. NOGENPROTODATAITEMS
  76. GLOBALSYMBOLTABLE=include:all.gst
  77. --------------------------------------------------------------------------
  78.  
  79. Same results without CODE=FAR.
  80.  
  81. If I try to compile and link with SASC 6.55 everything works fine:
  82.  
  83. --------------------------------------------------------------------------
  84. Home:Prog/problems/linker > sc link linkprob.c
  85. SAS/C Amiga Compiler 6.55
  86. Copyright (c) 1988-1995 SAS Institute Inc.
  87. ***Can't open GST file "include:all.gst" for read
  88. Slink - Version 6.55
  89. Copyright (c) 1988-1995 SAS Institute, Inc.  All Rights Reserved.
  90.  
  91.  
  92. SLINK Complete - Maximum code size = 85128 ($00014c88) bytes
  93.  
  94. Final output file size = 101192 ($00018b48) bytes
  95. --------------------------------------------------------------------------
  96.  
  97. The only chance to link with V6.56 is to split the large source
  98. code into smaller pieces.
  99.  
  100. Are there any workarounds other then splitting source code
  101. into smaller pieces?
  102.  
  103.  
  104. Steffen Gutmann
  105.  
  106. --
  107. gutmann@informatik.uni-ulm.de
  108.  
  109.  
  110.